#include<stdio.h>

int main(){

	int n;
	float sum=0.0;
	scanf("%d",&n);
	
	float arr[n];
	
	for (int i=0;i<n;i++){
		scanf("%f",&arr[i]);
		sum += arr[i];
	}
	
	float avg = sum / n;
	
	printf("%.2f\n", avg);
	
	for (int j=0;j<n;j++){
		j != n-1  ? printf("%.2f,",arr[j]-avg) : printf("%.2f",arr[j]-avg);
	}
	

	return 0;
}
